import upload from '@/utils/upload'
import request from '@/utils/request'
import { parseStrEmpty } from '@/utils/ruoyi'

// 用户密码重置
export function updateUserPwdCode() {
  return request({
    url: '/system/user/profile/updatePwd/code',
    method: 'get',
  })
}

// 用户密码重置
export function updateUserPwd(data) {
  return request({
    url: '/system/user/profile/updatePwd',
    method: 'put',
    data: data
  })
}

// 修改用户个人信息
export function updateUserProfile(data) {
  return request({
    url: '/system/user/profile',
    method: 'put',
    data: data
  })
}

// 用户头像上传
export function uploadAvatar(data) {
  return upload({
    url: '/system/user/profile/avatar',
    method: 'put',
    name: data.name,
    file: data.file
  })
}

